<?php
/**
* @Author By Chris
*
* Created on 2011-7-28
*
*/
class SettingModel extends Model
{
	public function getConfig()
	{
		if (!F('site_config')){
			$result = $this->select();
			foreach ($result as $v){
				$site_config[$v['skey']] = $v ['svalue'];			
			}
			F('site_config',$site_config);
			
		}
		return F('site_config');
	}
	
	public function updateConfig($k,$v)
	{
		
		return  $this->where(array('skey'=>$k))->data(array('svalue'=>$v))->save();
		
	}
}
?>